<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header">

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-content">
                    <form class="wizard-big" id="signupForm">
                        <h1>检测记录</h1>
                        <fieldset>
                            <h2>检测记录信息</h2>
                            <div class="row">
                                <div class="col-sm-8">
                                    <input id="purchaseId" name="purchaseId" th:value="${purchaseId}" type="hidden">
                                    <input id="warehousingRecordId" name="warehousingRecordId" th:value="${warehousingRecordId}" type="hidden">
                                    <input id="checkTemplateId" name="checkTemplateId" th:value="${checkTemplateId}" type="hidden">
                                    <div class="form-group">
                                        <label>记录名称：</label>
                                        <input id="recordName" name="recordName" th:value="${productName}" type="text" class="form-control required">
                                    </div>
                                    <div class="form-group">
                                        <label>检测人：</label>
                                        <input id="checkBy" name="checkBy" th:value="${userName}" type="text" class="form-control required">
                                    </div>
                                    <div class="form-group">
                                        <label>编号：</label>
                                        <input id="recordNo" name="recordNo" type="number" class="form-control required">
                                    </div>
                                    <!--<div class="form-group">-->
                                        <!--<label>检测模板：</label>-->
                                        <!--<select id="checkTemplateId" name="checkTemplateId" onchange="getCheckArrtByTemplateId()" class="form-control required">-->

                                        <!--</select>-->
                                    <!--</div>-->
                                </div>
                                <div class="col-sm-4">
                                    <div class="text-center">
                                        <div style="margin-top: 20px">
                                            <i class="fa fa-sign-in" style="font-size: 180px;color: #e5e5e5 "></i>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </fieldset>
                        <h1>检测记录属性</h1>
                        <fieldset>
                            <h2>检测记录属性信息</h2>
                            <div class="row" style="max-height: 270px;overflow-y: scroll;">
                                <div class="col-sm-6"  id="recordArrt">
                                    <!--<div class="form-group">-->
                                        <!--<label>属性值：</label>-->
                                        <!--<input id="arrtValues" name="arrtValues" type="text" class="form-control required">-->
                                    <!--</div>-->
                                </div>
                                <!--<div class="col-sm-6">-->
                                    <!--<div class="form-group">-->
                                        <!--<label>Email *</label>-->
                                        <!--<input id="email" name="email" type="text" class="form-control required email">-->
                                    <!--</div>-->
                                    <!--<div class="form-group">-->
                                        <!--<label>地址 *</label>-->
                                        <!--<input id="address" name="address" type="text" class="form-control">-->
                                    <!--</div>-->
                                <!--</div>-->
                            </div>
                        </fieldset>
                        <!--<div class="form-group">-->
                            <!--<div class="col-sm-8 col-sm-offset-3">-->
                                <!--<button type="submit" class="btn btn-primary">提交</button>-->
                            <!--</div>-->
                        <!--</div>-->
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/plugins/staps/jquery.steps.min.js}"  src="/js/plugins/staps/jquery.steps.min.js"></script>
<script type="text/javascript" th:src="@{/js/appjs/check/checkRecord/add.js}" src="/js/appjs/check/checkRecord/add.js">
</script>
<script type="text/javascript">
    $(document).ready(function () {
//        $("#wizard").steps();
        $("#signupForm").steps({
            bodyTag: "fieldset",
            onStepChanging: function (event, currentIndex, newIndex) {
                // Always allow going backward even if the current step contains invalid fields!
                if (currentIndex > newIndex) {
                    return true;
                }

                // Forbid suppressing "Warning" step if the user is to young
                if (newIndex === 3 && Number($("#age").val()) < 18) {
                    return false;
                }

                var form = $(this);

                // Clean up if user went backward before
                if (currentIndex < newIndex) {
                    // To remove error styles
                    $(".body:eq(" + newIndex + ") label.error", form).remove();
                    $(".body:eq(" + newIndex + ") .error", form).removeClass("error");
                }

                // Disable validation on fields that are disabled or hidden.
                form.validate().settings.ignore = ":disabled,:hidden";

                // Start validation; Prevent going forward if false
                return form.valid();
            },
            onStepChanged: function (event, currentIndex, priorIndex) {
                // Suppress (skip) "Warning" step if the user is old enough.
                if (currentIndex === 2 && Number($("#age").val()) >= 18) {
                    $(this).steps("next");
                }

                // Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
                if (currentIndex === 2 && priorIndex === 3) {
                    $(this).steps("previous");
                }
            },
            onCanceled: function (event) {// 取消按钮得监听
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                //layer.msg(index);
                parent.layer.close(index); //再执行关闭

            },
            onFinishing: function (event, currentIndex) {
                var form = $(this);

                // Disable validation on fields that are disabled.
                // At this point it's recommended to do an overall check (mean ignoring only disabled fields)
                form.validate().settings.ignore = ":disabled";

                // Start validation; Prevent form submission if false
                return form.valid();
            },
            onFinished: function (event, currentIndex) {
                var form = $(this);

                // Submit form input
                form.submit();
            }
        }).validate({
            errorPlacement: function (error, element) {
                element.before(error);
            },
            rules: {
                confirm: {
                    equalTo: "#password"
                }
            }
        });
    })
</script>
</body>
</html>
